Open Telemetry
Observability
Observability is everywhere. Observability essentially refers to observing the data that is generated by the system.
What is OpenTelemetry?
OpenTelemetry is a default open source standard for observability. It is a collection of APIs, SDKs, and tools that help you collect, process, and export telemetry data from your applications. The idea is that my application does not reinstrument the whole system with the vendors code. If I ever want to change the vendor, its just a config change.
-
Protocol: The protocol is really good. The protocol defines the data model that we are going to use so the application only sends the data in a specific format.
-
SDKs: The SDKs are available for various programming languages. The SDKs are used to collect the telemetry data from the application.
-
Signals: These are the different data models or types of telemetry data that we can collect from the application. Cureent signals that we have are:
- Traces
- Metrics
- Logs
- Profiles
- RUM
Traces
Traces are used to track the flow of a request through the system. It has a focus on Causality and Performance. We do not create a trace. We create spans. A span is a unit of work that is performed by the application. A trace is a collection spans with the same trace Id. Each span has a:
- Unique Id
- Trace Id
- Start Time
- End Time
- Parent Span ID
- Attributes
Logs
They are things that are a point in time and are designed for humans. They are useful for Startup/Crashes or debugging tracing (lol).
The issue with logging is that it is not structured and it can get hard to query and reason about. With traces the failure can be better queried.
Metric
Metric is something that used to measure things. Ideally its a bucket of signals.
- Time series aggregation.
- Cheap to Store
The issue is that it lacks deep context. They have low cardnanlity.
What is Propogation
The real magic of Open Telemetry comes from propogation. The idea is
-
Corelation
-
State
-
W3C Trace Headers
- TraceId
- ParentSpanId
- Sampling
-
Baggage: Additional context between services.
What is Auto Instrumentation
- This is a codeless Instrumentation.
- Env variable config.
- Sideloaded.